package com.le.tester.book.concurrentchallenge.executorSelf;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledThreadPoolExecutor;

/**
 * createTime：2025-03-30 9:41
 * description：
 */
public class TaskExecutionWebServer {

    private static final int NTHREADS = 100;

    private static final Executor exec = Executors.newFixedThreadPool(NTHREADS);

    public static void main(String[] args) throws IOException {
        ServerSocket socket = new ServerSocket(80);
        while (true) {
            final Socket accept = socket.accept();
            Runnable task = () -> {
                // handleRequest(accept);
            };
            exec.execute(task);
        }

        //ScheduledThreadPoolExecutor
    }
}
